﻿Public Class frmLogin

#Region "Eventos"

    Private Sub txtLogin_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtLogin.KeyDown
        If (e.KeyCode = Keys.Enter) Then
            SendKeys.Send("{TAB}")
        End If
    End Sub

    Private Sub cmdSair_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSair.Click
        Me.Close()
    End Sub

#End Region

#Region "Métodos"

    Public Function validaCampos() As Boolean

        Dim bRetorno As Boolean = True

        Me.epAcesso.Clear()

        If Me.txtLogin.Text = String.Empty Then
            Me.epAcesso.SetError(txtLogin, "Login obrigatório.")
            bRetorno = False
        End If

        If Me.txtSenha.Text = String.Empty Then
            Me.epAcesso.SetError(txtSenha, "Senha obrigatória.")
            bRetorno = False
        End If

        Return bRetorno

    End Function

#End Region


End Class
